Data-Driven Car Following Model using Python

The models predict Acceleration and calculate Subject Vehicle Trajectories. We have used multiple machine learning models in this project.

Neel Chaudhari true
07-13-2022

Car Following Terms width=“70%” height=“70%”>

📘 Table of Contents

Table of Contents
  1. ➤ About The Project
  2. ➤ Prerequisites
  3. ➤ Dataset
  4. ➤ Roadmap
  5. ➤ Preprocessing
  6. ➤ Results and Discussion
  7. ➤ TroubleShoot
  8. ➤ Contributors

✎ About The Project

This project aims to understand and explore trajectories of various Car Following Models that predict Acceleration. The raw NGSIM data will be preprocessed to cleanup bad data and filter only valid pairs that would help train the model on I-80 and US-101 Highways. The goal is to compare and evaluate the performance of different Models (Random Forest, k Nearest Neighbors, and CNN) and discuss the trajectories along with their R^2 and RMSE.

💠 Problem Statement

💠 Proposed Solution

🍴 Prerequisites

made-with-python
Made withJupyter
made-with-VSCode

The following open source packages are used in this project: * Numpy * Pandas * TensorFlow * Keras * Matplotlib * Sklearn * pathlib * random * seaborn * pickle * streamlit

💾 Dataset

The dataset used in this project is called * Next Generation Simulation (NGSIM) * and it is publicly available on the U.S. Department of Transportation website. The NGSIM dataset consists of 25 columns and 11.8 million rows of vehicle trajectory data which was captured using a network of synchronized digital video cameras on 4 different locations (US 101, I-80, Peachtree, and Lankershim). The data contains the location of a vehicle at every one-tenth of a second, which gives the exact position of each vehicle relative to other vehicles. A total of 3 different types of vehicle data can be found in this dataset, namely Car, Truck, and Motorcycle. Most of the data were taken from the two freeways i.e., US 101 and I-80, and among the three vehicle types, data on Cars is more as compared to Trucks and Motorcycles. Therefore, we decided to work on only the Freeways. After the Preliminary analysis, we found that some vehicle IDs are present in more than one location meaning that the data from all four locations were taken separately and then merged in a single file. Hence, we separated the data based on location to carry out data cleaning and data transformation and then merge them back.

NGSIM

highways

The NGSIM dataset is publicly available. Please refer to the Link

⛙ Roadmap

We trained three models namely k-Nearest Neighbors, Random Forest, and CNN to predict Acceleration for Subject Vehicle and find rest of the trajectory. The goals of this project include the following:

  1. Clean and Transform the NGSIM Data

  2. Train Random Forest, KNN and CNN on same Train Data.

  3. Compare R2 and RMSE for the models.

  4. Validate Vehicle Trajectories and compare with R2 and RMSE outcomes.

🔨 Preprocessing

The NGSIM (Next Generation Simulation) dataset includes vehicle trajectory details along with the information of Lead and Following vehicle IDs. Even though the dataset has been processed by the Transportation department there are quite a few instances of Bad Data and vehicle trajectories which wont help in training for a good Car following model. Thus, we have preprocessed the data as per below:

💠 Data-Cleanup

Below are the cleanup tasks that have been performed:

cleanup

🔶 Data Transformation

Below are the transformation steps that have been followed:

Transformation

🔍 Results and Discussion

The overall accuracy score of personal and impersonal models are shown in the following tables. Some of the results we observed are similar to the results obtained by Weiss et.al and they are discussed below:

Stats and Model Details

📜 Contributors

🎓 All participants in this project are Student of Post Graduate Diploma in Data Analytics for Business @ St Clair College

👦 Vineet Dhamija
      Email: VD17@myscc.ca
      GitHub: @VineetDhamija

👦 Neel Chaudhari
      Email: NC57@myscc.ca
      GitHub: @neelschaudhari000

👦 Rakesh Singh
      Email: rs334@myscc.ca
      GitHub: @rakesh894

👦 Umair Durrani
      Email: UDURRANI@stclaircollege.ca
      GitHub: @durraniu


This was the final project for the course DAB402- Capstone (Summer 2022), at St Clair College

Corrections

If you see mistakes or want to suggest changes, please create an issue on the source repository.

Citation

For attribution, please cite this work as

Chaudhari (2022, July 13). Neel Chaudhari: Data-Driven Car Following Model using Python. Retrieved from https://neelchaudhari.netlify.app/projects/2022-07-24-Car Following Data-Driven Model/

BibTeX citation

@misc{chaudhari2022data-driven,
  author = {Chaudhari, Neel},
  title = {Neel Chaudhari: Data-Driven Car Following Model using Python},
  url = {https://neelchaudhari.netlify.app/projects/2022-07-24-Car Following Data-Driven Model/},
  year = {2022}
}